From: Michael Tokarev Date: Tue, 20 Jan 2026 19:27:54 +0000 (+0300) Subject: inline getprogname replacement X-Git-Tag: archive/raspbian/2%4.23.5+dfsg-1+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7165eeaa53b244ed7ac03c994cb24a051a4e1f39;p=samba.git inline getprogname replacement Forwarded: not-needed Inline getprogname() by using program_invocation_short_name when available (like with glibc). This makes a lot of binaries to avoid linkage to libreplace. This is a short and dirty version, proper change for upstream should clean up #ifdef'fery in replace.c. Gbp-Pq: Name inline-getprogname.diff --- diff --git a/lib/replace/replace.c b/lib/replace/replace.c index d6b1383c..1d5f2eb7 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -983,7 +983,7 @@ int rep_memset_s(void *dest, size_t destsz, int ch, size_t count) } #endif /* HAVE_MEMSET_S */ -#ifndef HAVE_GETPROGNAME +#if !defined(HAVE_GETPROGNAME) && !defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME) # ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME # define PROGNAME_SIZE 32 static char rep_progname[PROGNAME_SIZE]; diff --git a/lib/replace/replace.h b/lib/replace/replace.h index a67d9cc3..c7d7aca1 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -1005,9 +1005,13 @@ int rep_memset_s(void *dest, size_t destsz, int ch, size_t count); #endif #ifndef HAVE_GETPROGNAME +#ifdef HAVE_PROGRAM_INVOCATION_SHORT_NAME +# define getprogname() (program_invocation_short_name) +#else #define getprogname rep_getprogname const char *rep_getprogname(void); #endif +#endif #ifndef HAVE_COPY_FILE_RANGE #define copy_file_range rep_copy_file_range